/* 储存合同管理- 合同列表 相关请求 */

import { ajaxService } from '@/utils/request';
import { PostContractCodeInfo } from '../type';

const env = import.meta.env;
let baseURL = env.VITE_CONTRACT_URL;
let appUrl = env.VITE_SUPPLOER_URL;

/* --------------------------------------------------------------------------------------------------------*/

/* 合同模块 合同列表 设置模块 表头设计 */

// 表头设计

// 获取 表头
export function GetContractHeader(params?: any) {
  return ajaxService({
    url: '/contract/list/header/get',
    method: 'get',
    baseURL,
    params,
  });
}

// 修改 表头
export function PutContractHeader(data: any) {
  return ajaxService({
    url: '/contract/list/header/edit',
    method: 'put',
    baseURL,
    data,
  });
}

/* --------------------------------------------------------------------------------------------------------*/

/* 合同 操作   */

// 获取 合同列表
export function GetContractListAll(params?: any) {
  return ajaxService({
    url: '/contract/list/getAll',
    method: 'get',
    baseURL,
    params,
  });
}

// 删除 合同
export function DeleteContract(params: any) {
  return ajaxService({
    url: `/contract/list/del`,
    method: 'delete',
    baseURL,
    params,
  });
}

// 获取 合同详情
export function GetContractDetail(params: any) {
  return ajaxService({
    url: '/contract/list/getById',
    method: 'get',
    baseURL,
    params,
  });
}

// 添加 合同
export function PostContract(data: any) {
  return ajaxService({
    url: '/contract/list/add',
    method: 'post',
    baseURL,
    data,
  });
}

// 修改 合同
export function PutContract(data: any) {
  return ajaxService({
    url: '/contract/list/edit',
    method: 'put',
    baseURL,
    data,
  });
}

// 获取 合同详情
export function GetContractTemplateStatusOn(data: any) {
  return ajaxService({
    url: '/contract/template/getByTemplateStatusOn',
    method: 'get',
    params: data,
    baseURL,
  });
}

// 新增 客户合同记录新增
export function postContractRecords(data: any) {
  return ajaxService({
    url: '/client/customer/contract',
    method: 'post',
    data,
    baseURL,
  });
}

// 添加供应商合同记录
export function postSupplierContractRecords(data: any) {
  return ajaxService({
    url: '/supplier/list/contract/add',
    method: 'post',
    data,
    baseURL: appUrl,
  });
}

/* --------------------------------------------------------------------------------------------------------*/

/* --------------------------------------------------------------------------------------------------------*/

/* 合同 操作   */

/* --------------------------------------------------------------------------------------------------------*/

/* --------------------------------------------------------------------------------------------------------*/

/* 合同 操作   */

/* --------------------------------------------------------------------------------------------------------*/
